package model

import "github.com/gogf/gf/v2/util/gmeta"

type DepartmentInfoReq struct {
	DepartmentName   string `json:"departmentName"  dc:"部门名称"  v:"required|length:1,10#部门名字必填|部门名字1~10字"`
	DepartmentRemark string `json:"departmentRemark" dc:"部门备注"  v:"length:1,45#部门备注1~45字"`
	ParentId         int64  `json:"parentId" dc:"父级id" v:"required#父级id必填"`
	CompanyId        int64  `json:"companyId" dc:"公司Id" v:"required#公司id必填"`
}

type DepartmentIdReq struct {
	Id int64 `json:"id"  dc:"部门id"    v:"required#部门id必填"`
}

type BranchDepartmentIdRes struct {
	DepartmentIds []int64 `json:"departmentIds"   dc:"部门权限id数组"`
}

type DepartmentInfoRes struct {
	gmeta.Meta       `orm:"table:lot_department"`
	DepartmentName   string `json:"departmentName"  dc:"部门名称"  v:"required|length:1,10#部门名字必填|部门名字1~10字"`
	DepartmentRemark string `json:"departmentRemark" dc:"部门备注"  v:"required|length:1,45#部门备注必填|部门备注1~45字"`
	ParentId         int64  `json:"parentId" dc:"父级id" d:"0"`
	Id               int64  `json:"id"  dc:"部门id"    v:"required#部门id必填"`
}

type DepartmentIdRes struct {
	Id int64 `json:"id"  dc:"部门id" `
}

type DepartmentTreeRes struct {
	Id        int64 `json:"id"  dc:"部门id" `
	CompanyId int64 `json:"companyId" dc:"公司Id" v:"required#公司id必填"`
}

type DepartmentListReq struct {
	DepartmentName string `json:"departmentName"  dc:"部门名称"  v:"length:1,10#部门名字1~10字"`
	CompanyId      int64  `json:"companyId" dc:"公司Id" v:"required#公司id必填"`
	*Paging
}

type EditDepartment struct {
	DepartmentIdReq
	DepartmentName   string `json:"departmentName"  dc:"部门名称"  v:"required|length:1,10#部门名字必填|部门名字1~10字"`
	DepartmentRemark string `json:"departmentRemark" dc:"部门备注"  v:"required|length:1,45#部门备注必填|部门备注1~45字"`
}

type DepartmentTreeInfoRes struct {
	DepartmentName   string                  `json:"departmentName"  dc:"部门名称"  v:"required|length:1,10#部门名字必填|部门名字1~10字"`
	Id               int64                   `json:"id" dc:"部门id"    v:"required#部门id必填"`
	ParentId         int64                   `json:"parentId"`
	CompanyId        int64                   `json:"companyId" dc:"公司Id"`
	DepartmentRemark string                  `json:"departmentRemark" dc:"部门备注"  v:"required|length:1,45#部门备注必填|部门备注1~45字"`
	Children         []DepartmentTreeInfoRes `json:"children"`
}

type DepartmentSearchInfo struct {
	Id        int64 `json:"id"`
	CompanyId int64 `json:"companyId"`
}

type DepartmentListRes struct {
	List []*DepartmentInfoRes `json:"list" dc:"部门列表"`
	PutPage
}
